<template>
  
    <div class="view-frame">
      <div  class="view-head">
                  <el-breadcrumb separator="/">
                    <el-breadcrumb-item>用户</el-breadcrumb-item>
                    <el-breadcrumb-item>用户管理</el-breadcrumb-item>
                  </el-breadcrumb>
      </div>
      <div class="view-body">
        <div class="view-body-main">
          <portlet name="用户管理">
            <el-row>
              <el-col :span="24">
                <el-row :gutter="5">
                  <el-col :span="6">
                    <el-input v-model="name" placeholder="请输入用户名"></el-input>
                  </el-col>
                  <el-col :span="2">
                    <el-button  icon="search" type="primary"  @click="search">查询</el-button>
                  </el-col>
                  <el-col :span="2">
                    <el-button icon="plus" type="primary" @click="dialogFormVisible = true">新增</el-button>
                  </el-col>
                  <el-col :span="2">
                    <el-button icon="delete"  @click="delet" type="primary">删除</el-button>
                  </el-col>
                  <el-col :span="2">
                    <el-button  icon="edit"  type="primary" @click="update">修改</el-button>
                  </el-col>
                  <el-col :span="4">
                    <el-button  icon="share"  type="primary" @click="payManage">用户管理</el-button>
                  </el-col>
                 
                </el-row>
                <el-row>
                  
                </el-row>
                <el-row>
                  <el-col :span="24">
                      <el-table
                       
                        ref="table"
                        v-loading="loading"
                        :data="tableData"
                        style="width: 100%"
                        highlight-current-row
                        @current-change="handleTableChange">
                        <el-table-column
                          prop="name"
                          label="门店名称">
                        </el-table-column>
                        <el-table-column
                          prop="merchant_id"
                          label="商户id">
                        </el-table-column>  
                      </el-table>
                      <div class="table-footer">
                          <el-pagination
                            @size-change="handleSizeChange"
                            @current-change="handleCurrentChange"
                            :current-page="page"
                            :page-sizes="[10, 20, 30, 40]"
                            :page-size="rows"
                            layout="total, sizes, prev, pager, next"
                            :total="total">
                          </el-pagination>
                      </div>
                        
                  </el-col>
                </el-row>
              </el-col>
            </el-row>
          </portlet>
        </div>
      </div>
      <el-dialog title="新增用户" v-model="dialogFormVisible">
        <el-form :model="form">
        <el-row :gutter="20">
                <el-col :span="20">
                  <el-form-item label="门店名称:" label-width="100px">
                       <el-input v-model="form.name" auto-complete="off"></el-input>
                  </el-form-item>
                  <el-form-item label="商户id:" label-width="100px">
                       <el-input v-model="form.merchant_id" auto-complete="off"></el-input>
                  </el-form-item>
                </el-col>
             </el-row>
          
        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button @click="dialogFormVisible = false">取 消</el-button>
          <el-button type="primary" @click="add">确 定</el-button>
        </div>
      </el-dialog>
      <el-dialog title="修改用户" v-model="dialogForm1Visible">
        <el-form :model="form1">
        <el-row :gutter="20">
                <el-col :span="20">
                  <el-form-item label="门店名称:" label-width="100px">
                       <el-input v-model="form1.name" auto-complete="off"></el-input>
                  </el-form-item>
                  <el-form-item label="商户id:" label-width="100px">
                       <el-input v-model="form1.merchant_id" auto-complete="off"></el-input>
                  </el-form-item>
                </el-col>
             </el-row>      
        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button @click="dialogForm1Visible = false">取 消</el-button>
          <el-button type="primary" @click="update1">确 定</el-button>
        </div>
      </el-dialog>
      <el-dialog title="店员列表" v-model="dialogMenuOperate" size='large'>
        <div v-if='checked!=null'>
          <out-table :father='checked.id'></out-table>
        </div>
      </el-dialog>
      <el-dialog title="店员列表">
          <el-row :gutter="5">
                  <el-col :span="6">
                    <el-input v-model="name" placeholder="请输入用户名"></el-input>
                  </el-col>
                  <el-col :span="2">
                    <el-button  type="primary"  @click="search">查询</el-button>
                  </el-col>
                  <el-col :span="2">
                    <el-button  type="primary" @click="newTable = true">新增</el-button>
                  </el-col>
                  <el-col :span="2">
                    <el-button   type="primary" @click="bChangeTable">修改</el-button>
                  </el-col>
                 
          </el-row>
          
          <el-table
            ref="table"
            :data="data2"
            style="width: 100%"
            highlight-current-row
            @current-change="handleTableChange2">
            <el-table-column
              prop="login_code"
              label="登陆码">
            </el-table-column>
             <el-table-column
              prop="forein_type"
              label="店员类型">
            </el-table-column>
            <el-table-column
              prop="createdate"
              label="创建日期">
            </el-table-column>
          </el-table>
      </el-dialog>
      <el-dialog title="增加支付渠道" v-model="newTable">
        <el-row>
          <el-col :span="24">
            
            <el-form :model="form3">
              <el-form-item label="合作方商户编码" label-width="70px">
                <el-input v-model="form3.merchantId" auto-complete="off"></el-input>
              </el-form-item>
              <el-form-item label="银行商户编码" label-width="70px">
                <el-input v-model="form3.merchantCode" auto-complete="off"></el-input>
              </el-form-item>
            </el-form>
            <el-row>
              <el-col :span="24">
                <el-button @click="newTable = false">取 消</el-button>
                <el-button type="primary" @click="addTable">确 定</el-button>
              </el-col>
            </el-row>
            
          </el-col>
        </el-row>
      </el-dialog>
      <el-dialog title="修改支付渠道" v-model="chTable">
        <el-row>
          <el-col :span="24">
            <el-form :model="form4">
               <el-form-item label="合作方商户编码" label-width="70px">
                <el-input v-model="form4.merchantId" auto-complete="off"></el-input>
              </el-form-item>
              <el-form-item label="银行商户编码" label-width="70px">
                <el-input v-model="form4.merchantCode" auto-complete="off"></el-input>
              </el-form-item>
            </el-form>
            <el-row>
              <el-col :span="24">
                <el-button @click="chTable = false">取 消</el-button>
                <el-button type="primary" @click="changeTable">确 定</el-button>
              </el-col>
            </el-row>
            
          </el-col>
        </el-row>
      </el-dialog>

    </div>
</template>
<script>
    import _default from "./index.js";
    import './index.scss';
    export default _default;
</script>

